/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


import Server.BUS.StringUlti;
import Server.DTO.DeleteNoWhereQuery;
import Server.DTO.Query;
import org.junit.*;
import static org.junit.Assert.*;

/**
 *
 * @author Trung
 */
public class DeleteNoWhereQueryTest {
    
    public DeleteNoWhereQueryTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }

    @Test
    public void testDeleteNoWhereQueryContructor1()
    {
        // TODO review the generated test code and remove the default call to fail.
        String queryString = "DELETE FROM TableA";
        queryString = StringUlti.formatString(queryString);
        DeleteNoWhereQuery dnw = new DeleteNoWhereQuery(queryString);
        
        assertTrue(dnw.keyWord.equalsIgnoreCase("DELETE_NOWHERE"));
        assertTrue(dnw.queryString.equalsIgnoreCase(queryString));
        assertTrue(dnw.tableName.equalsIgnoreCase("TableA"));  
    }
    
    @Test
    public void testDeleteNoWhereQueryContructor2()
    {
        // TODO review the generated test code and remove the default call to fail.
        String queryString = "   DELETE    FROM    TableA   ";
        queryString = StringUlti.formatString(queryString);
        DeleteNoWhereQuery dnw = new DeleteNoWhereQuery(queryString);
        
        assertTrue(dnw.keyWord.equalsIgnoreCase("DELETE_NOWHERE"));
        assertTrue(dnw.queryString.equalsIgnoreCase(queryString));
        assertTrue(dnw.tableName.equalsIgnoreCase("TableA"));       
    }
}
